package day05;
//break 关键字演示
public class BreakDemo {
    public static void main(String[] args) {
        /*
        for (int num = 1; num <= 9; num++) {
            if (num  == 4){//在某种特定的条件下,提前结束
                break;//跳出循环
            }
            System.out.println(num+"*9="+num*9);
        }
        */
        for (int num = 1; num <= 9; num++) {
            if (num == 4) {//判断
                break;//跳出循环
            }
            System.out.println(num+"*9="+num*9);
        }
        /*
        * 执行过程
        * for循环开始
        * num=1 num==4? false 输出 1*9=9
        * num=2 num==4? false 输出 2*9=18
        * num=3 num==4? false 输出 3*9=27
        * num=4 num==4? ture 结束循环
        * */
    }
}
